package fr.cephb.joperon.client;

import com.google.gwt.dom.client.Node;
import com.google.gwt.user.client.Element;

public class DOMUtils
	{
	public static Element findDescendantdByName(Element e,String name)
		{
		if(e.getNodeName().equalsIgnoreCase(name)) return e;
		for(Node n=e.getFirstChild(); n!=null;n=n.getNextSibling())
			{
			if(n.getNodeType()!=Node.ELEMENT_NODE) continue;
			Element p= findDescendantdByName((Element)n, name);
			if(p!=null) return p;
			}
		return null;
		}
	}
